package com.cl.mapper;

import com.cl.pojo.Situation;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
@Mapper
public interface SituationMapper {
    /**
     * 添加一个异常
     * @param sNo
     * @param qDate
     * @param qReaction
     * @return
     */
    int addSituation(@Param("sNo")int sNo,@Param("qDate")String qDate,@Param("qReaction")String qReaction,@Param("yes")String yes);

    /**
     * 根据sNo查找异常
     * @param sNo
     * @return
     */
    Situation queryBySno(@Param("sNo")int sNo);

    /**
     * 查询接种反应
     * @param page
     * @param limit
     * @return
     */
    List<Map<String,Object>> querySituation(@Param("page")int page,@Param("limit")int limit,@Param("name")String name,@Param("yon")String yon);

    int countAll();

    /**
     * 查询异常总数
     * @return
     */
    int countAbnormal();

    /**
     * 查询正常总数
     * @return
     */
    int countNormal();
}
